home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
OS2
/
MEMSIZ.ARJ
/
ABOUT.C
next >
Wrap
C/C++ Source or Header
|
1991-05-17
|
4KB
|
129 lines
/**************************************************************** ABOUT.C
* *
* Display "ABOUT" Dialog Box *
* *
************************************************************************/
#define INCL_WIN
#define INCL_GPI
#include <os2.h>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "about.h"
#include "object.h"
/************************************************************************
* Function Prototypes *
************************************************************************/
static METHODFUNCTION InitDlg ;
static METHODFUNCTION Command ;
/************************************************************************
* Global Data Declarations *
************************************************************************/
static METHOD Methods [] =
{
{ WM_INITDLG, InitDlg },
{ WM_COMMAND, Command }
} ;
/************************************************************************
* *
* "About" Dialog Box Procedure *
* *
************************************************************************/
MRESULT EXPENTRY AboutProcessor
( HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2 )
{
return
(
GeneralMessageProcessor
(
hwnd,
msg,
mp1,
mp2,
Methods,
sizeof(Methods)/sizeof(METHOD),
WinDefDlgProc,
NULL
)
) ;
}
/************************************************************************
* *
* Initialize Dialog *
* *
************************************************************************/
static MRESULT APIENTRY InitDlg
(
HWND hwnd,
USHORT msg,
MPARAM mp1,
MPARAM mp2,
void *data
)
{
ABOUT_PARMS *Parms = (ABOUT_PARMS*) ( PVOIDFROMMP ( mp2 ) ) ;
WinSetWindowUShort ( hwnd, QWS_ID, Parms->id ) ;
if ( Parms->hwndHelp )
{
WinAssociateHelpInstance ( Parms->hwndHelp, hwnd ) ;
}
return ( MRFROMSHORT ( FALSE ) ) ;
hwnd = hwnd ; msg = msg ; mp1 = mp1 ; mp2 = mp2 ; data = data ;
}
/************************************************************************
* *
* Process commands received by Dialog. *
* *
************************************************************************/
static MRESULT APIENTRY Command
(
HWND hwnd,
USHORT msg,
MPARAM mp1,
MPARAM mp2,
void *data
)
{
/***********************************************************************
* Process action according to which control is reporting . . . *
***********************************************************************/
switch ( SHORT1FROMMP ( mp1 ) )
{
/*********************************************************************
* If it was the OK or CANCEL button, dismiss the dialog box. *
*********************************************************************/
case DID_OK:
case DID_CANCEL:
{
WinDismissDlg ( hwnd, TRUE ) ;
return ( 0 ) ;
}
}
return ( 0 ) ;
hwnd = hwnd ; msg = msg ; mp1 = mp1 ; mp2 = mp2 ; data = data ;
}